/*
 * @Author: lp
 * @Date: 2022-01-07 14:28:13
 * @LastEditTime: 2022-06-21 15:25:51
 * @LastEditors: 瞿旺兴 18774621495@163.com
 * @Description: 插件汇总
 * @FilePath: \nien-vue3-admin\vite\plugins\index.ts
 */
import vue from '@vitejs/plugin-vue'
// import { Plugin } from 'vite'
import vueJsx from '@vitejs/plugin-vue-jsx'
import OptimizationPersist from 'vite-plugin-optimize-persist'
import PkgConfig from 'vite-plugin-package-config'
import SetupExtend from 'vite-plugin-vue-setup-extend'
import AutoImport from './autoImport'
import Components from './components'
import svgIcon from './svgIcon'
import ViteRestart from './restartVite'
import compressPlugin from './compression'
import vueI18n from './vueI18n'

export default function createVitePlugins(viteEnv, isBuild = false) {
  const vitePlugins = [
    vue(), 
    OptimizationPersist(), 
    PkgConfig(), 
    AutoImport,
    Components,
    svgIcon,
    ViteRestart,
    vueJsx(),
    SetupExtend(),
    compressPlugin('gzip', isBuild),
    vueI18n]
  return vitePlugins
}
